import unittest

# loader

# 1.模块名
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1')
# loader2 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo2')

# 2.类名
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1.TestDemo1TestCase')

# 3.方法名
# loader1 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo1.TestDemo1TestCase.test1')
# loader2 = unittest.defaultTestLoader.loadTestsFromName('test_cases.test_demo2.TestDemo1TestCase.testb')

lists = ['test_cases.test_demo1.TestDemo1TestCase.test1',
         'test_cases.test_demo2.TestDemo2TestCase.testb'
         ]
loader1 = unittest.defaultTestLoader.loadTestsFromNames(lists)
# suite1
suite = unittest.TestSuite()
suite.addTests(loader1)

# runner
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
